package com.central.dataManage.controller;


import com.central.common.model.Result;
import com.central.dataManage.service.ITableService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Tindy
 * @date 2021/6/24
 * @describe
 */
@Slf4j
@RestController
@Api(tags = "sql编辑模块api")
@RequestMapping(value = "/sqlEdit")
public class SqlEditController {

    @Autowired
    private ITableService tableService;

    @ApiOperation(value = "格式化sql")
    @GetMapping("/format")
    public Result<String> format(Long datasourceId, String sql) {
        return tableService.format(datasourceId,sql);
    }
}
